This page last changed on Jan 01, 2009.
How To Create the Physical Data Service for the LDAP Sample
This topic describes how to create a physical data service based on the LDAP sample application.
Topic Map
Supporting LDAP Server Entries Through Data Services
Installing the Oracle Data Service Integrator Retail Dataspace Sample
- If it is not already running, launch Workshop for WebLogic.
- If you have not already done so, install the Oracle Data Service Integrator Retail Dataspace Sample. The sample creates a dataspace for retail data services that connects to a relational database and web services.
Importing JAR Files
Two separate import operations into the Retail Dataspace project are needed.
Import Source |
Contents |
Spring LDAP 1.2.1 JAR |
Basic LDAP support classes. |
ldap_java.jar |
Java functions needed by the new physical data service. |
 |
If you have not already done so, unzip the project ZIP file LdapJavaDsp32.zip into a temporary directory. The project files are located in the LdapJavaDsp32 directory. |
Importing Spring LDAP JAR Files
To import the Spring LDAP JAR files which were included with the LDAP sample:
- Expand the Retail Dataspace project and locate the DSP-INF/lib folder.
Project Explorer - DSP-INF/lib Folder

- Right-click the DSP-INF/lib folder and choose Import.
- Select General > File System and click Next.
Import Source Dialog

- For the From directory field click Browse, select the LdapJavaDsp32/lib folder, and click OK.
Importing the Spring LDAP JAR Files

- Click the checkbox next to lib to select all JAR files in the library; then click Finish. The wizard imports the selected JAR files.
Importing the ldap_java.jar File
The ldap_java.jar file contains Java functions for your new physical data service.
To import the ldap_java.jar file:
- Right-click the DSP-INF/lib folder and choose Import.
- Select General > File System, then Next.
- For the From directory field click Browse, select the LdapJavaDsp32/dist folder, and click OK.
Importing the ldap_java.jar File

- Click the checkbox next to dist, then click Finish. The wizard imports the ldap_java.jar file.
Creating the Physical Data Service
You need to create the physical data service that uses Java functions to facilitate data access.
 |
You can inspect the Java functions; they are in the DspLdapWrapper.java file. |
To create the physical data service:
- In the Project Explorer right-click RetailDataspace/Physical, and choose New > Physical Data Service.
Creating a New Physical Data Service

- Choose Java Function from the Data source type drop-down list.
- Click Browse next to the Class name field. The Open Java Class dialog appears.
- Navigate to:
ldap_java/com/example/ldap/DspLdapWrapper.class
- Click Open.
Open Java Class

- Click Next.
- Select all functions except:
{{main(java.lang.String)}}
- Select the updatePersonSDO() function
- Select the With Change Summary checkbox.
Select Java Function

- Click Next.
- Configure the settings in the Review New/Updated Data Service Operation(s) step, as shown in the following table:
Operation |
Public |
Kind |
Primary |
updatePersonXMLBean |
Yes |
Update |
|
updatePersonSDO |
Yes |
Update |
|
deletePerson |
Yes |
Delete |
Yes |
createPerson |
Yes |
Create |
Yes |
getPersonByUserId |
Yes |
Read |
|
getAllPersons |
Yes |
Read |
|
Review New/Updated Data Service Operation(s)

- Click Next.
- Type a Data Service Name, such as:
- Click Finish.
Update the Procedure Declaration
The procedure declaration generated by the New Physical Data Service Wizard needs to be modified.
 | This step is a workaround for CR365986 in the import wizard. Once you make these code changes to correctly list inetOrgPerson it will work correctly and will treat the function as a primary update procedure. |
To update the procedure declaration:
- Double-click the data service in the Project Explorer.
- Click the Source tab.
- Update the pragma of the updatePersonSDO() procedure to set the operation as primary, as shown in the following:
<f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="update" isPrimary="true" nativeName="updatePersonSDO">
- Update the declaration for the updatePersonSDO() procedure to match the following (make sure the namespace prefix matches your source):
declare procedure f1:updatePersonSDO($x1 as changed-element(t1:inetOrgPerson)*) as empty() external;
- Choose File > Save from the main menu.
- Redeploy the project.
You can now perform create, read, update and delete (CRUD) operations against an LDAP server. For example, in Test view you can run the getAllPersons() operation.
Testing the getAllPersons() LDAP Operation
 LDAP Operation.gif)
You can also optionally create new logical data services that combine this physical data service with other data services, such as RDBMS, Web Services, and so on.
Next Step
Related Topics
Concepts
How Tos
|